<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />

    

    
    <title>什么是ORM(Object Relational Mapping) | welcome</title>
    
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    
    <meta name="keywords" content="jdbc,orm" />
    
    <meta name="description" content="什么是ORM？为什么要用ORM？在了解ORM之前，应该先了解下面的概念： 1、什么是“持久化(Persistence)”把数据（如内存中的对象）保存到可以永久保存的存储设备中（比如计算机的硬盘），持久化的作用就是将内容中的数据存储在关系型数据库中。 2、什么是“持久层(Persistence Layer)”？持久层专注于实现持久化应用领域的某个系统的一个逻辑层面，将数据使用者（软件开发人员）与数">
<meta property="og:type" content="article">
<meta property="og:title" content="什么是ORM(Object Relational Mapping)">
<meta property="og:url" content="https://hchdream.gitee.io/hexo/2020/04/30/%E4%BA%86%E8%A7%A3%E4%B8%80%E4%B8%8BORM/index.html">
<meta property="og:site_name" content="welcome">
<meta property="og:description" content="什么是ORM？为什么要用ORM？在了解ORM之前，应该先了解下面的概念： 1、什么是“持久化(Persistence)”把数据（如内存中的对象）保存到可以永久保存的存储设备中（比如计算机的硬盘），持久化的作用就是将内容中的数据存储在关系型数据库中。 2、什么是“持久层(Persistence Layer)”？持久层专注于实现持久化应用领域的某个系统的一个逻辑层面，将数据使用者（软件开发人员）与数">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://hchdream.gitee.io/images/img/portfolio/04-large.jpg">
<meta property="article:published_time" content="2020-04-29T16:00:00.000Z">
<meta property="article:modified_time" content="2020-10-28T08:33:43.956Z">
<meta property="article:author" content="XiaoHuang">
<meta property="article:tag" content="jdbc">
<meta property="article:tag" content="orm">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://hchdream.gitee.io/images/img/portfolio/04-large.jpg">
    

    
        <link rel="alternate" href="/atom.xml" title="welcome" type="application/atom+xml" />
    

    
        <link rel="icon" href="/hexo/css/images/favicon.ico" />
    

    
<link rel="stylesheet" href="/hexo/libs/font-awesome/css/font-awesome.min.css">

    
<link rel="stylesheet" href="/hexo/libs/titillium-web/styles.css">

    
<link rel="stylesheet" href="/hexo/libs/source-code-pro/styles.css">


    
<link rel="stylesheet" href="/hexo/css/style.css">


    
<script src="/hexo/libs/jquery/3.5.0/jquery.min.js"></script>

    
    
        
<link rel="stylesheet" href="/hexo/libs/lightgallery/css/lightgallery.min.css">

    
    
        
<link rel="stylesheet" href="/hexo/libs/justified-gallery/justifiedGallery.min.css">

    
    
    
    


<meta name="generator" content="Hexo 5.2.0"></head>

<body>
    <div id="wrap">
        <header id="header">
    <div id="header-outer" class="outer">
        <div class="container">
            <div class="container-inner">
                <div id="header-title">
                    <h1 class="logo-wrap">
                        <a href="/hexo/" class="logo"></a>
                    </h1>
                    
                </div>
                <div id="header-inner" class="nav-container">
                    <a id="main-nav-toggle" class="nav-icon fa fa-bars"></a>
                    <div class="nav-container-inner">
                        <ul id="main-nav">
                            
                                <li class="main-nav-list-item" >
                                    <a class="main-nav-list-link" href="/hexo/">主页</a>
                                </li>
                            
                                    <ul class="main-nav-list"><li class="main-nav-list-item"><a class="main-nav-list-link" href="/hexo/categories/Java/">Java</a></li><li class="main-nav-list-item"><a class="main-nav-list-link" href="/hexo/categories/Spring/">Spring</a></li><li class="main-nav-list-item"><a class="main-nav-list-link" href="/hexo/categories/nginx/">nginx</a></li><li class="main-nav-list-item"><a class="main-nav-list-link" href="/hexo/categories/springcloud/">springcloud</a></li><li class="main-nav-list-item"><a class="main-nav-list-link" href="/hexo/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a></li><li class="main-nav-list-item"><a class="main-nav-list-link" href="/hexo/categories/%E9%95%9C%E5%83%8F%E5%8A%A0%E9%80%9F/">镜像加速</a></li><li class="main-nav-list-item"><a class="main-nav-list-link" href="/hexo/categories/%E9%A1%B9%E7%9B%AE/">项目</a></li></ul>
                                
                                <li class="main-nav-list-item" >
                                    <a class="main-nav-list-link" href="/hexo/about/index.html">关于</a>
                                </li>
                            
                        </ul>
                        <nav id="sub-nav">
                            <div id="search-form-wrap">

    <form class="search-form">
        <input type="text" class="ins-search-input search-form-input" placeholder="搜索" />
        <button type="submit" class="search-form-submit"></button>
    </form>
    <div class="ins-search">
    <div class="ins-search-mask"></div>
    <div class="ins-search-container">
        <div class="ins-input-wrapper">
            <input type="text" class="ins-search-input" placeholder="想要查找什么..." />
            <span class="ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
(function (window) {
    var INSIGHT_CONFIG = {
        TRANSLATION: {
            POSTS: '文章',
            PAGES: '页面',
            CATEGORIES: '分类',
            TAGS: '标签',
            UNTITLED: '(未命名)',
        },
        ROOT_URL: '/hexo/',
        CONTENT_URL: '/hexo/content.json',
    };
    window.INSIGHT_CONFIG = INSIGHT_CONFIG;
})(window);
</script>

<script src="/hexo/js/insight.js"></script>


</div>
                        </nav>
                    </div>
                </div>
            </div>
        </div>
    </div>
</header>

        <div class="container">
            <div class="main-body container-inner">
                <div class="main-body-inner">
                    <section id="main">
                        <div class="main-body-header">
    <h1 class="header">
    
    <a class="page-title-link" href="/hexo/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a>
    </h1>
</div>

                        <div class="main-body-content">
                            <article id="post-了解一下ORM" class="article article-single article-type-post" itemscope itemprop="blogPost">
    <div class="article-inner">
        
            <header class="article-header">
                
    
        <h1 class="article-title" itemprop="name">
        什么是ORM(Object Relational Mapping)
        </h1>
    

            </header>
        
        
            <div class="article-meta">
                
  <div class="article-date">
    <i class="fa fa-calendar"></i>
    <a href="/hexo/2020/04/30/%E4%BA%86%E8%A7%A3%E4%B8%80%E4%B8%8BORM/" class="article-date">
       <time datetime="2020-04-29T16:00:00.000Z" itemprop="datePublished">2020-04-30</time>
    </a>
  </div>


<div class="article-date">
  <i class="fa fa-calendar-plus-o"></i>
  <a href="/hexo/2020/04/30/%E4%BA%86%E8%A7%A3%E4%B8%80%E4%B8%8BORM/" class="article-date">
     <time datetime="2020-10-28T08:33:43.956Z" itemprop="dateModified">2020-10-28</time>
  </a>
</div>


                

                
    <div class="article-tag">
        <i class="fa fa-tag"></i>
        <a class="tag-link-link" href="/hexo/tags/jdbc/" rel="tag">jdbc</a>, <a class="tag-link-link" href="/hexo/tags/orm/" rel="tag">orm</a>
    </div>

                

                

            </div>
        
        
        <div class="article-entry" itemprop="articleBody">
            

            

            

            <p><img src="https://hchdream.gitee.io/images/img/portfolio/04-large.jpg"></p>
<h1 id="什么是ORM？为什么要用ORM？"><a href="#什么是ORM？为什么要用ORM？" class="headerlink" title="什么是ORM？为什么要用ORM？"></a>什么是ORM？为什么要用ORM？</h1><p>在了解ORM之前，应该先了解下面的概念：</p>
<h2 id="1、什么是“持久化-Persistence-”"><a href="#1、什么是“持久化-Persistence-”" class="headerlink" title="1、什么是“持久化(Persistence)”"></a>1、什么是“持久化(Persistence)”</h2><p>把数据（如内存中的对象）保存到可以永久保存的存储设备中（比如计算机的硬盘），持久化的作用就是将内容中的数据存储在关系型数据库中。</p>
<h2 id="2、什么是“持久层-Persistence-Layer-”？"><a href="#2、什么是“持久层-Persistence-Layer-”？" class="headerlink" title="2、什么是“持久层(Persistence Layer)”？"></a>2、什么是“持久层(Persistence Layer)”？</h2><p>持久层专注于实现持久化应用领域的某个系统的一个逻辑层面，将数据使用者（软件开发人员）与数据库实体相关联。</p>
<h2 id="3、什么是ROM？"><a href="#3、什么是ROM？" class="headerlink" title="3、什么是ROM？"></a>3、什么是ROM？</h2><p>ORM(Object Relational Mapping)对象关系映射，在关系型数据库和对象之间作一个映射，因此，在具体的操作数据库的时候，不需要和复杂的SQL语句打交道，只要像平时操作对象一样操作它就行了。</p>
<h2 id="4、为什么要做持久化和ORM设计呢？"><a href="#4、为什么要做持久化和ORM设计呢？" class="headerlink" title="4、为什么要做持久化和ORM设计呢？"></a>4、为什么要做持久化和ORM设计呢？</h2><p>在当前的企业应用开发过程中，MVC为主要的系统架构模式，Model包含了复杂的业务逻辑和数据逻辑，以及数据存取机制(如 JDBC的连接、SQL的生成和 Statement创建、还有 ResultSet结果集的读取等)，将这些复杂的业务逻辑和数据逻辑分离，实际上就是降低系统代码的高耦合，因为开发过程中有很多代码涉及到对数据库的操作，降低代码的耦合度是迫切要做的内容，也是<strong>持久化</strong>要做的工作。MVC模式实现了架构上将View层（视图层）和Model层（数据处理层）分离的解耦合，持久化的设计实现了数据处理层内部的业务逻辑分离的解耦。ORM作为持久化设计中的最重要的也是最复杂的技术、是目前业界热点的技术。</p>
<p>在传统的JDBC操作数据库有以下操作，数据和数据库存取逻辑是混杂在一起的</p>
<p>1、建立数据库连接，获得Connection对象</p>
<p>2、根据用户的输入组装查询的SQL语句</p>
<p>3、根据SQL语句建立Statement对象或者PreparedStatement对象</p>
<p>4、用Connection对象执行SQL语句，获得结果集ResltSet对象</p>
<p>5、然后一条一条读取结果集ResultSet对象中的数据</p>
<p>6、根据读取到的数据，按特定的业务逻辑进行计算</p>
<p>7、根据计算得到的结果再组装更新SQL语句</p>
<p>8、再使用Connection对象执行更新SQL语句，以更新数据中的数据</p>
<p>9、最后还要关闭Statement对象和Connection对象</p>
<p>从上面的步骤可以看出代码逻辑非常复杂，这其中还不包括某条执行失败的语句的处理逻辑。 其中的业务处理逻辑和数据存取逻辑完全混杂在一块。而一个完整的系统要包含成千上万个这样重复的而又混杂的处理过程，假如要对其中某些业务逻辑或者一些相关联的业务流程做修改，要改动的代码量将不可想象。另一方面，假如要换数据库 产品或者运行环境也可能是个不可能完成的任务。而用户的运行环境和要求却千差万别，我们不可能为每一个用户每一种运行环境设计一套一样的系统。 </p>
<p>因此就要将一样的处理代码即业务逻辑和可能不一样的处理即数据存取逻辑分离开来，另一方面，关系型数据库中的数据基本都是以一行行的数据进行存取的，而程序运行却是一个个对象进行处理，而目前大部分数据库驱动技术（如ADO.NET、JDBC、ODBC等等）均是以行集的结果集一条条进行处理的。所以为解决 这一困难，就出现 ORM 这一个对象和数据之间映射技术。 </p>
<p> 举例来说，比如要完成一个购物打折促销的程序，用 ORM 思想将如下实现（引自《深入浅出Hibernate》）：<br>业务逻辑如下： </p>
<figure class="highlight java"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">public</span> Double <span class="title">calcAmount</span><span class="params">(String customerid, <span class="keyword">double</span> amount)</span> </span></span><br><span class="line"><span class="function"></span>&#123;</span><br><span class="line">    <span class="comment">// 根据客户ID获得客户记录</span></span><br><span class="line">    Customer customer = CustomerManager.getCustomer(custmerid); </span><br><span class="line">    <span class="comment">// 根据客户等级获得打折规则</span></span><br><span class="line">    Promotion promotion = PromotionManager.getPromotion(customer.getLevel()); </span><br><span class="line">    <span class="comment">// 累积客户总消费额，并保存累计结果</span></span><br><span class="line">    customer.setSumAmount(customer.getSumAmount().add(amount); </span><br><span class="line">    CustomerManager.save(customer); </span><br><span class="line">    <span class="comment">// 返回打折后的金额</span></span><br><span class="line">    <span class="keyword">return</span> amount.multiply(protomtion.getRatio()); </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>

<p> 这样的代码就非常清晰了，而且与数据存取逻辑完全分离。设计业务逻辑代码的时候完全不需要考虑数据库JDBC的那些千篇一律的操作，而将它交给 CustomerManager 和 PromotionManager 两个类去完成。这就是一个简单的 ORM 设计，实际的 ORM 实现框架比这个要复杂的多。 </p>
<hr>
<p>转载自： <a target="_blank" rel="noopener" href="https://blog.csdn.net/u010947534/article/details/90669452">https://blog.csdn.net/u010947534/article/details/90669452</a> </p>

        </div>
        <footer class="article-footer">
            



    <a data-url="https://hchdream.gitee.io/hexo/2020/04/30/%E4%BA%86%E8%A7%A3%E4%B8%80%E4%B8%8BORM/" data-id="ckqnkn7it000fs8rjdsx6d10u" class="article-share-link"><i class="fa fa-share"></i>分享到</a>
<script>
    (function ($) {
        $('body').on('click', function() {
            $('.article-share-box.on').removeClass('on');
        }).on('click', '.article-share-link', function(e) {
            e.stopPropagation();

            var $this = $(this),
                url = $this.attr('data-url'),
                encodedUrl = encodeURIComponent(url),
                id = 'article-share-box-' + $this.attr('data-id'),
                offset = $this.offset(),
                box;

            if ($('#' + id).length) {
                box = $('#' + id);

                if (box.hasClass('on')){
                    box.removeClass('on');
                    return;
                }
            } else {
                var html = [
                    '<div id="' + id + '" class="article-share-box">',
                        '<input class="article-share-input" value="' + url + '">',
                        '<div class="article-share-links">',
                            '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
                            '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
                            '<a href="http://pinterest.com/pin/create/button/?url=' + encodedUrl + '" class="article-share-pinterest" target="_blank" title="Pinterest"></a>',
                            '<a href="https://plus.google.com/share?url=' + encodedUrl + '" class="article-share-google" target="_blank" title="Google+"></a>',
                        '</div>',
                    '</div>'
                ].join('');

              box = $(html);

              $('body').append(box);
            }

            $('.article-share-box.on').hide();

            box.css({
                top: offset.top + 25,
                left: offset.left
            }).addClass('on');

        }).on('click', '.article-share-box', function (e) {
            e.stopPropagation();
        }).on('click', '.article-share-box-input', function () {
            $(this).select();
        }).on('click', '.article-share-box-link', function (e) {
            e.preventDefault();
            e.stopPropagation();

            window.open(this.href, 'article-share-box-window-' + Date.now(), 'width=500,height=450');
        });
    })(jQuery);
</script>

        </footer>
    </div>
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "BlogPosting",
        "author": {
            "@type": "Person",
            "name": "XiaoHuang"
        },
        "headline": "什么是ORM(Object Relational Mapping)",
        "image": "https://hchdream.gitee.io/hexohttps://hchdream.gitee.io/images/img/portfolio/04-large.jpg",
        "keywords": "jdbc orm",
        "genre": "数据库",
        "datePublished": "2020-04-30",
        "dateCreated": "2020-04-30",
        "dateModified": "2020-10-28",
        "url": "https://hchdream.gitee.io/hexo/2020/04/30/了解一下ORM/",
        "description": "
什么是ORM？为什么要用ORM？在了解ORM之前，应该先了解下面的概念：
1、什么是“持久化(Persistence)”把数据（如内存中的对象）保存到可以永久保存的存储设备中（比如计算机的硬盘），持久化的作用就是将内容中的数据存储在关系型数据库中。
2、什么是“持久层(Persistence Layer)”？持久层专注于实现持久化应用领域的某个系统的一个逻辑层面，将数据使用者（软件开发人员）与数",
        "wordCount": 150
    }
</script>

</article>

    <section id="comments">
    
        
    <div id="disqus_thread">
        <noscript>Please enable JavaScript to view the <a target="_blank" rel="noopener" href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
    </div>


    
    </section>



                        </div>
                    </section>
                    <aside id="sidebar">
    <a class="sidebar-toggle" title="Expand Sidebar"><i class="toggle icon"></i></a>
    <div class="sidebar-top">
        <p>关注我 :</p>
        <ul class="social-links">
            
                
                <li>
                    <a class="social-tooltip" title="github" href="https://github.com/hchdream" target="_blank" rel="noopener">
                        <i class="icon fa fa-github"></i>
                    </a>
                </li>
                
            
                
                <li>
                    <a class="social-tooltip" title="rss" href="/hexo/atom.xml" target="_blank" rel="noopener">
                        <i class="icon fa fa-rss"></i>
                    </a>
                </li>
                
            
        </ul>
    </div>
    
        
<nav id="article-nav">
    
        <a href="/hexo/2020/04/30/MyBatis/" id="article-nav-newer" class="article-nav-link-wrap">
        <strong class="article-nav-caption">下一篇</strong>
        <p class="article-nav-title">
        
            在idea下实现MyBatis的helloworld
        
        </p>
        <i class="icon fa fa-chevron-right" id="icon-chevron-right"></i>
    </a>
    
    
        <a href="/hexo/2020/04/29/vue%E4%B8%8B%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8yarn/" id="article-nav-older" class="article-nav-link-wrap">
        <strong class="article-nav-caption">上一篇</strong>
        <p class="article-nav-title">vue下如何使用yarn</p>
        <i class="icon fa fa-chevron-left" id="icon-chevron-left"></i>
        </a>
    
</nav>

    
    <div class="widgets-container">
        
            
                

            
                
    <div class="widget-wrap">
        <h3 class="widget-title">最新文章</h3>
        <div class="widget">
            <ul id="recent-post" class="">
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/hexo/2021/07/03/SpringCloud-Alibaba/" class="thumbnail">
    
    
        <span style="background-image:url(https://w.wallhaven.cc/full/j3/wallhaven-j3wqwm.jpg)" alt="SpringCloud&amp;Alibaba" class="thumbnail-image"></span>
    
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/hexo/categories/springcloud/">springcloud</a></p>
                            <p class="item-title"><a href="/hexo/2021/07/03/SpringCloud-Alibaba/" class="title">SpringCloud&amp;Alibaba</a></p>
                            <p class="item-date"><time datetime="2021-07-03T08:26:10.000Z" itemprop="datePublished">2021-07-03</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/hexo/2021/01/29/nginx/" class="thumbnail">
    
    
        <span style="background-image:url(http://hchdream.gitee.io/images/img/portfolio/08-large.jpg)" alt="nginx入门" class="thumbnail-image"></span>
    
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/hexo/categories/nginx/">nginx</a></p>
                            <p class="item-title"><a href="/hexo/2021/01/29/nginx/" class="title">nginx入门</a></p>
                            <p class="item-date"><time datetime="2021-01-28T16:00:00.000Z" itemprop="datePublished">2021-01-29</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/hexo/2020/10/29/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" class="thumbnail">
    
    
        <span style="background-image:url(http://hchdream.gitee.io/images/img/portfolio/10-large.jpg)" alt="网络编程" class="thumbnail-image"></span>
    
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"><a class="article-category-link" href="/hexo/categories/Java/">Java</a></p>
                            <p class="item-title"><a href="/hexo/2020/10/29/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/" class="title">网络编程</a></p>
                            <p class="item-date"><time datetime="2020-10-29T05:39:12.000Z" itemprop="datePublished">2020-10-29</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/hexo/2020/10/27/%E6%B5%8B%E8%AF%95/" class="thumbnail">
    
    
        <span style="background-image:url(https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2926199504,3558053336&fm=26&gp=0.jpg)" alt="测试" class="thumbnail-image"></span>
    
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/hexo/2020/10/27/%E6%B5%8B%E8%AF%95/" class="title">测试</a></p>
                            <p class="item-date"><time datetime="2020-10-27T08:16:08.000Z" itemprop="datePublished">2020-10-27</time></p>
                        </div>
                    </li>
                
                    <li>
                        
                        <div class="item-thumbnail">
                            <a href="/hexo/2020/10/27/hello-world/" class="thumbnail">
    
    
        <span style="background-image:url(https://hchdream.gitee.io/images/img/portfolio/04-large.jpg)" alt="Hello World" class="thumbnail-image"></span>
    
    
</a>

                        </div>
                        
                        <div class="item-inner">
                            <p class="item-category"></p>
                            <p class="item-title"><a href="/hexo/2020/10/27/hello-world/" class="title">Hello World</a></p>
                            <p class="item-date"><time datetime="2020-10-27T05:33:45.370Z" itemprop="datePublished">2020-10-27</time></p>
                        </div>
                    </li>
                
            </ul>
        </div>
    </div>

            
                
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">分类</h3>
        <div class="widget">
            <ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/hexo/categories/Java/">Java</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/hexo/categories/Spring/">Spring</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/hexo/categories/nginx/">nginx</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/hexo/categories/springcloud/">springcloud</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/hexo/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库</a><span class="category-list-count">4</span></li><li class="category-list-item"><a class="category-list-link" href="/hexo/categories/%E9%95%9C%E5%83%8F%E5%8A%A0%E9%80%9F/">镜像加速</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/hexo/categories/%E9%A1%B9%E7%9B%AE/">项目</a><span class="category-list-count">1</span></li></ul>
        </div>
    </div>


            
                
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">归档</h3>
        <div class="widget">
            <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/07/">七月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2021/01/">一月 2021</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2020/10/">十月 2020</a><span class="archive-list-count">3</span></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2020/06/">六月 2020</a><span class="archive-list-count">1</span></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2020/05/">五月 2020</a><span class="archive-list-count">6</span></li><li class="archive-list-item"><a class="archive-list-link" href="/hexo/archives/2020/04/">四月 2020</a><span class="archive-list-count">3</span></li></ul>
        </div>
    </div>


            
                
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">标签</h3>
        <div class="widget">
            <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/AOP/" rel="tag">AOP</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/Collection/" rel="tag">Collection</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/DI/" rel="tag">DI</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/HashMap/" rel="tag">HashMap</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/HashTabel/" rel="tag">HashTabel</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/IOC/" rel="tag">IOC</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/List/" rel="tag">List</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/Map/" rel="tag">Map</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/Set/" rel="tag">Set</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/TreeMap/" rel="tag">TreeMap</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/idea/" rel="tag">idea</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/jdbc/" rel="tag">jdbc</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/jpa/" rel="tag">jpa</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/mybatis/" rel="tag">mybatis</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/mysql/" rel="tag">mysql</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/npm/" rel="tag">npm</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/orm/" rel="tag">orm</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/properties/" rel="tag">properties</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/thymeleaf/" rel="tag">thymeleaf</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/xml/" rel="tag">xml</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/yarn/" rel="tag">yarn</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F/" rel="tag">代理模式</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/hexo/tags/%E6%B3%9B%E5%9E%8B/" rel="tag">泛型</a><span class="tag-list-count">1</span></li></ul>
        </div>
    </div>


            
                
    <div class="widget-wrap widget-float">
        <h3 class="widget-title">标签云</h3>
        <div class="widget tagcloud">
            <a href="/hexo/tags/AOP/" style="font-size: 10px;">AOP</a> <a href="/hexo/tags/Collection/" style="font-size: 10px;">Collection</a> <a href="/hexo/tags/DI/" style="font-size: 10px;">DI</a> <a href="/hexo/tags/HashMap/" style="font-size: 10px;">HashMap</a> <a href="/hexo/tags/HashTabel/" style="font-size: 10px;">HashTabel</a> <a href="/hexo/tags/IOC/" style="font-size: 10px;">IOC</a> <a href="/hexo/tags/List/" style="font-size: 10px;">List</a> <a href="/hexo/tags/Map/" style="font-size: 10px;">Map</a> <a href="/hexo/tags/Set/" style="font-size: 10px;">Set</a> <a href="/hexo/tags/TreeMap/" style="font-size: 10px;">TreeMap</a> <a href="/hexo/tags/idea/" style="font-size: 20px;">idea</a> <a href="/hexo/tags/jdbc/" style="font-size: 20px;">jdbc</a> <a href="/hexo/tags/jpa/" style="font-size: 10px;">jpa</a> <a href="/hexo/tags/mybatis/" style="font-size: 20px;">mybatis</a> <a href="/hexo/tags/mysql/" style="font-size: 10px;">mysql</a> <a href="/hexo/tags/npm/" style="font-size: 10px;">npm</a> <a href="/hexo/tags/orm/" style="font-size: 10px;">orm</a> <a href="/hexo/tags/properties/" style="font-size: 10px;">properties</a> <a href="/hexo/tags/thymeleaf/" style="font-size: 10px;">thymeleaf</a> <a href="/hexo/tags/xml/" style="font-size: 15px;">xml</a> <a href="/hexo/tags/yarn/" style="font-size: 10px;">yarn</a> <a href="/hexo/tags/%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8F/" style="font-size: 10px;">代理模式</a> <a href="/hexo/tags/%E6%B3%9B%E5%9E%8B/" style="font-size: 10px;">泛型</a>
        </div>
    </div>


            
                
    <div class="widget-wrap widget-list">
        <h3 class="widget-title">链接</h3>
        <div class="widget">
            <ul>
                
                    <li>
                        <a target="_blank" rel="noopener" href="http://hexo.io">Hexo</a>
                    </li>
                
                    <li>
                        <a target="_blank" rel="noopener" href="https://github.com">Github</a>
                    </li>
                
                    <li>
                        <a target="_blank" rel="noopener" href="https://baidu.com">Baidu</a>
                    </li>
                
            </ul>
        </div>
    </div>


            
        
    </div>
</aside>

                </div>
            </div>
        </div>
        <footer id="footer">
    <div class="container">
        <div class="container-inner">
            <a id="back-to-top" href="javascript:;"><i class="icon fa fa-angle-up"></i></a>
            <div class="credit">
                <h1 class="logo-wrap">
                    <a href="/hexo/" class="logo"></a>
                </h1>
                <p>&copy; 2021 XiaoHuang</p>
                
                <p>Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.</p>
                
            </div>
            <div class="footer-plugins">
              
    


            </div>
        </div>
	</div>
</footer>


    </div>
    
    
    <script>
    var disqus_shortname = 'hexo-theme-hueman';
    
    
    var disqus_url = 'https://hchdream.gitee.io/hexo/2020/04/30/%E4%BA%86%E8%A7%A3%E4%B8%80%E4%B8%8BORM/';
    
    (function() {
    var dsq = document.createElement('script');
    dsq.type = 'text/javascript';
    dsq.async = true;
    dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();
    </script>





    
        
<script src="/hexo/libs/lightgallery/js/lightgallery.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-thumbnail.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-pager.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-autoplay.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-fullscreen.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-zoom.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-hash.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-share.min.js"></script>

        
<script src="/hexo/libs/lightgallery/js/lg-video.min.js"></script>

    
    
        
<script src="/hexo/libs/justified-gallery/jquery.justifiedGallery.min.js"></script>

    
    

    
    
    



<!-- Custom Scripts -->

<script src="/hexo/js/main.js"></script>


</body>
</html>
